package org.s.com.springioc.controller;

import org.s.com.springioc.model.User;
import org.s.com.springioc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

//@Controller//表现层使用的注解(将bean存储到ioc中)
public class HelloController {

    //@Autowired
    private UserService userService;
    @Bean
    public User user1(){
        return new User ("zhangsan");
    }
    @Bean
    public User user2(){
        return new User ("lisi");
    }
    @Autowired
    public HelloController(UserService userService){
        this.userService=userService;
    }
    public HelloController(){

    }



}
